﻿@model BulkExpressOrderModel

@{
    ViewBag.Title = T("Admin.Customers.Customers.BulkPlaceOrder").Text;
    var gridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSize;
}

@using Telerik.Web.Mvc.UI
@using (Html.BeginForm("BulkPlaceExpressOrderConfirm", "Customer"))
{
    @Html.ValidationSummary(false)
    @Html.HiddenFor(model => model.CustomerId)
    @Html.HiddenFor(model => model.Id)

    <div class="section-header">
        <div class="title">
            <img src="@Url.Content("~/subsites/Administration/Content/images/ico-customers.png")" alt="" />
            @T("Admin.Customers.Customers.BulkPlaceOrder") @Html.ActionLink("(" + T("Admin.Customers.Customers.Addresses.BackToCustomer") + ")", "Edit", new { id = Model.CustomerId })
        </div>
        <div class="options">
            <input type="submit" value="@T("Admin.Customers.Customers.BulkPlaceExpressOrderConfirm")" class="t-button" />
        </div>
    </div>

    <div>
        <p><b>@T("Admin.Logistics.Package.Info"):</b></p>

        <table class="adminContent">
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.IsLetterSize) :
                </td>
                <td class="adminData">
                    @Html.CheckBoxFor(model => model.IsLetterSize)
                </td>
            </tr>
        </table>

        <table id="package-measurement" class="adminContent">
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.Length):
                </td>
                <td class="adminData">
                    @Html.TextBoxFor(model => model.Length) (@Html.DisplayFor(model => model.DimensionMeasureUnit))
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.Width):
                </td>
                <td class="adminData">
                    @Html.TextBoxFor(model => model.Width) (@Html.DisplayFor(model => model.DimensionMeasureUnit))
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.Height):
                </td>
                <td class="adminData">
                    @Html.TextBoxFor(model => model.Height) (@Html.DisplayFor(model => model.DimensionMeasureUnit))
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.Weight):
                </td>
                <td class="adminData">
                    @Html.TextBoxFor(model => model.Weight) (@Html.DisplayFor(model => model.WeightMeasureUnit))
                </td>
            </tr>
        </table>

        <table class="adminContent">
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.NoSignature) :
                </td>
                <td class="adminData">
                    @Html.CheckBoxFor(model => model.NoSignature)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.IsVertical) :
                </td>
                <td class="adminData">
                    @Html.CheckBoxFor(model => model.IsVertical)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.IsDangerous) :
                </td>
                <td class="adminData">
                    @Html.CheckBoxFor(model => model.IsDangerous)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.IsFragile) :
                </td>
                <td class="adminData">
                    @Html.CheckBoxFor(model => model.IsFragile)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.AdditionalInstruction) :
                </td>
                <td class="adminData">
                    @Html.EditorFor(model => model.AdditionalInstruction)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.InsuranceValue) :
                </td>
                <td class="adminData">
                    @Html.EditorFor(model => model.InsuranceValue)
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    @Html.NopLabelFor(model => model.Comment) :
                </td>
                <td class="adminData">
                    @Html.EditorFor(model => model.Comment)
                </td>
            </tr>
        </table>
    </div>

    <table class="adminContent">
        <tr>
            <td>
                <br />
                <strong>@T("Admin.Logistics.DeliveryAddress").Text</strong>
            </td>
        </tr>
        @if (Model.Addresses.Count > 0)
        {
            for (int i = 0; i < Model.Addresses.Count; i++)
            {
                <tr class="adminSeparator">
                    <td colspan="2">
                        <hr />
                        No.@(i + 1) :
                    </td>
                </tr>
                <tr>
                    <td>
                        @Html.EditorFor(model => model.Addresses[i], "Address")
                        <table class="adminContent">
                            <tr>
                                <td class="adminTitle">
                                    @Html.NopLabelFor(model => model.Addresses[i].TypeId):
                                </td>
                                <td class="adminData">
                                    @Html.DropDownListFor(model => model.Addresses[i].TypeId, Model.Addresses[i].AvailableTypes)
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            }
        }
    </table>
}

<script type="text/javascript">
    $("#IsLetterSize").change(function () {
        var that = this;
        $("#package-measurement").toggle(!that.checked);
    }).change()
</script>

